package com.k2data.k2app.mapper;

import com.k2data.k2app.domain.po.v1.Contacts;
import com.k2data.k2app.domain.po.v1.RFile;
import com.k2data.k2app.mybatis.mapper.K2Mapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface ContactsMapper extends K2Mapper<Contacts> {

    /**
     * 根据客户获取联系人信息
     *
     * @param customerId
     * @return List<Contacts>
     */
    List<Contacts> getByCustomer(@Param("customerId") Long customerId);

    /**
     * 根据设备获取联系人信息
     *
     * @param deviceId
     * @return List<Contacts>
     */
    List<Contacts> getByDevice(@Param("deviceId") Long deviceId);
    List<Contacts> getByCustomerAll(@Param("customerId") Long customerId);

    int insertBatch(List<Contacts> list);
    long insertOfSelective(Contacts contacts);
}
